function template(id, data) {
    var str = document.querySelector(id).innerHTML;
    const reg = /{{\s*([a-zA-Z]+)\s*}}/;
    var fl = null;
    console.log(str)
    while ((fl = reg.exec(str))) {
        console.log(fl)
        console.log(data)
        str = str.replace(fl[0], data[fl[1]])
    }
    return str;
}